import { define } from 'cydon'
import { EditableTable } from './EditableTable'
import { error } from '../utils'
import { warning } from '@cydon/ui/Message'
import { API } from '../api'

@define('manage-node')
export class ManageNode extends EditableTable<{
	selected?: boolean
}> {
	/** 同步图片 */
	syncPosts() {
		const items = this.items.filter(x => x.selected)
		if (!items.length)
			warning('未选中任何项目')
	}

	/** 同步标签 */
	syncTags() {
		const items = this.items.filter(x => x.selected)
		if (!items.length)
			warning('未选中任何项目')
	}
}

declare global {
	interface HTMLElementTagNameMap {
		'manage-node': ManageNode
	}
}
